package model.entityInclude;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.List;

import model.entity.ReinsuranceBillingEntity;

import baseclass.BaseBill;

/**
 * 
 * 處理檔案
 * 
 **/
public class ReinsuranceBilling extends BaseBill<ReinsuranceBillingEntity>
{

    /**
     * 
     */
    private static final long serialVersionUID=1L;

    @SuppressWarnings({ "unchecked", "rawtypes" })
    @Override
    public List inFile(String path) throws IOException
    {
	inFile=new InputStreamReader(new FileInputStream(path),"ISO8859_1");
	brFile=new BufferedReader(inFile);
	while ((Line=brFile.readLine())!=null)
	{
	    ReinsuranceBillingEntity bill=new ReinsuranceBillingEntity();
	    bill.setWORK_CESSION_NO((Line.substring(0,10)));
	    bill.setWORK_PLY_LOC(Line.substring(10,22));
	    bill.setWORK_RISK_NO(Line.substring(22,32));
	    bill.setWORK_FAC_INT(Line.substring(32,42));
	    bill.setWORK_LIMIT_QSRATE(Line.substring(42,52));
	    bill.setWORK_ACC_RETRATE(Line.substring(52,67));
	    bill.setWORK_RISK_AMT(Line.substring(67,82));
	    bill.setWORK_OUR_QSAMT(Line.substring(82,97));
	    bill.setWORK_RATE(Line.substring(97,105));
	    bill.setWORK_RISKPRM_REIN(Line.substring(105,120));
	    bill.setWORK_BEGIN_DAY(Line.substring(120,127));
	    bill.setWORK_END_DAY(Line.substring(127,134));
	    bill.setWORK_DAYS(Line.substring(134,137));
	    bill.setWORK_DAYM(Line.substring(137,140));
	    bill.setWORK_PREM(Line.substring(140,155));
	    bill.setWORK_ISSU_DAY(Line.substring(155,162));
	    bill.setWORK_TYPE(Line.substring(162,163));
	    bills.add(bill);
	}
	return bills;
    }

}
